#include"Sort.h"

void TestInsert()
{
	int a[] = { 1,4,6,8,3,6,9,10 };
	Print(a, sizeof(a) / sizeof(a[0]));
	InsertSort(a, sizeof(a) / sizeof(a[0]));
	Print(a, sizeof(a) / sizeof(a[0]));
}

void TestShellSort()
{
	int a[] = { 1,4,6,8,3,6,9,10 };
	Print(a, sizeof(a) / sizeof(a[0]));
	ShellSort(a, sizeof(a) / sizeof(a[0]));
	Print(a, sizeof(a) / sizeof(a[0]));
}

void TestBubbleSort()
{
	int a[] = { 1,4,6,8,3,6,9,10 };
	Print(a, sizeof(a) / sizeof(a[0]));
	BubbleSort(a, sizeof(a) / sizeof(a[0]));
	Print(a, sizeof(a) / sizeof(a[0]));
}

void TestSelectSort()
{
	int a[] = { 1,4,6,8,3,6,9,10 };
	Print(a, sizeof(a) / sizeof(a[0]));
	SelectSort(a, sizeof(a) / sizeof(a[0]));
	Print(a, sizeof(a) / sizeof(a[0]));
}

void TestHeapSort()
{
	int a[] = { 1,4,6,8,3,6,9,10 };
	Print(a, sizeof(a) / sizeof(a[0]));
	HeapSort(a, sizeof(a) / sizeof(a[0]));
	Print(a, sizeof(a) / sizeof(a[0]));
}

void TestQuickSort()
{
	int a[] = { 1,4,6,8,3,6,9,10 };
	Print(a, sizeof(a) / sizeof(a[0]));
	QuickSort(a,0,sizeof(a) / sizeof(a[0])-1);
	Print(a, sizeof(a) / sizeof(a[0]));
}

void TestQuickSortNonR()
{
	int a[] = { 1,4,6,8,3,6,9,10 };
	Print(a, sizeof(a) / sizeof(a[0]));
	QuickSortNonR(a, 0, sizeof(a) / sizeof(a[0]) - 1);
	Print(a, sizeof(a) / sizeof(a[0]));
}

void TestMergeSort()
{
	int a[] = { 1,4,6,8,3,6,9,10 };
	Print(a, sizeof(a) / sizeof(a[0]));
	MergeSort(a,sizeof(a) / sizeof(a[0]) - 1);
	Print(a, sizeof(a) / sizeof(a[0]));
}

int main()
{
	//TestInsert()
	//TestShellSort();
	//TestBubbleSort();
	//TestSelectSort();
    //TestHeapSort();
	//TestQuickSortNonR();
	TestMergeSort();
	return 0;
}